<?php
	DEFINE('H1', 'Convert Using Form');
	DEFINE('TITLE','Convert Using Form');
	require('includes/header.php');
?>	
	<h2><?PHP echo H1 ?></h2>
<?php
if (!isset($_POST['submit'])) {
?>
<form method="post" action="convertform.php">
Enter Euro Rate: <br />
<input type="text" name="euroRate" /><br />
Enter Dollars to Convert: <br />
<input type="text" name="dollars" />
<p>
<input type="submit" name="submit" value="Submit" />
</p>
</form>

<?php
} else {
$rate = $_POST['euroRate'];
$dollars = $_POST['dollars'];
$euros = $dollars * $rate;
echo "$dollars USD is equivalent to: $euros EUR";
}
?>


<?php
	require('includes/footer.php');
?>